package com.fizzkai.p2p.core.domain;

import lombok.Getter;
import lombok.Setter;

import java.util.Date;

@Getter@Setter
public class IpLog extends BaseDomain {
    public static final int STATE_FAILED = 0;   // 登录失败
    public static final int STATE_SUCCESS = 1;  // 登录成功
    private String username;//登陆用户
    private Date loginTime;//登陆时间
    private String ip;//来源IP
    private int state;//登陆状态
    private int userType;//用户类型


    public String getStateDisplay(){
        return state == STATE_FAILED ? "失败" : "成功";
    }
    public String getUserTypeDisplay (){
        return userType == LoginInfo.USERTYPE_USER ? "普通用户" : "后台用户";
    }
}
